library SelfService_dll;

uses
  Winapi.ActiveX,
  System.Win.ComObj,
  System.IniFiles,
  System.SysUtils,
  Web.WebBroker,
  Web.Win.ISAPIApp,
  Web.Win.ISAPIThreadPool,
  WebModuleUnit1 in 'WebModuleUnit1.pas' {WebModule1: TWebModule},
  selfserviceImpl in 'selfserviceImpl.pas',
  selfserviceIntf in 'selfserviceIntf.pas',
  NativeXml in 'NativeXml.pas',
  Unit_globle in 'Unit_globle.pas',
  Unit_SbClinicInterface in 'Unit_SbClinicInterface.pas',
  mz_function_dtm in 'mz_function_dtm.pas' {mz_function: TSoapDataModule};

{$R *.res}

exports
  GetExtensionVersion,
  HttpExtensionProc,
  TerminateExtension;

var
  MyIniFile : TIniFile;
begin
  CoInitFlags := COINIT_MULTITHREADED;
  sInstallDirectory := GetDllPath('SelfService_dll.dll');
  sInstallDirectory := Copy(sInstallDirectory,5,Length(sInstallDirectory) - 4) + '\';

  MyIniFile := TIniFile.Create(sInstallDirectory+'SelfService.ini');
  gv_app_server := MyIniFile.ReadString('Server','AppServer','' );
  gv_mz_dept_no :=inttostr(MyIniFile.Readinteger('Chis','mz_dept_no',1));
  gv_user_mi := MyIniFile.ReadString('Chis','user_mi','00000');
  gv_round := MyIniFile.Readinteger('Chis','Round',100);
  case gv_round of
    100: gv_format := '#0.00';
    10: gv_format := '#0.0';
    1: gv_format := '#0';
    else gv_format := '#0.00'
  end;
  gv_autowin := Trim(MyIniFile.Readstring('Chis','auto_distribute_win','0'));
  gv_led_display := Trim(MyIniFile.Readstring('Chis','LED_DISPLAY','0'));
  gv_team_no := Trim(MyIniFile.ReadString('Chis', 'Team_No', '1'));
  MyIniFile.Free;

  InitSbClinicDll;
  Application.Initialize;
  Application.WebModuleClass := WebModuleClass;
  Application.Run;
end.
